package com.kude.manager;

import com.kude.dao.AdministratorDAO;
import com.kude.entity.Administrator;


public class AdministratorManager extends AbstractManager<Administrator,AdministratorDAO>{

	public AdministratorManager() {
		this.tableName = Administrator.TABLE_NAME;
	}

	public boolean isExist(Administrator obj) throws OperException {
		if(obj == null) {
			throw new OperException("管理员对象obj不能为空");
		}
		if(obj.getAdminId() == null) {
			return false;
		}
		if(dao.getById(obj.getAdminId()) == null) {
			return false;
		}
		return true;
	}
	
	public void setAdministratorDAO(AdministratorDAO administratorDAO) {
		this.dao = administratorDAO;
	}

}
